package com.hedl.practice.diyJava.exception.assertion;

public class JavaAndAssertion {
    public static void main(String [] args){
        /*double x = Math.abs(-123.45);
        assert x >= 0 : "x must >= 0";
        System.out.println(x);*/

        /**
         * 断言很少使用；一般不被开启，如果断言出错会抛出异常AssertionError
         */
        int x = -1;
        assert x > 0;
        System.out.println(x);
    }
}
